using System;
using NUnit.Framework;

namespace Solver
{
	/// <summary>
	/// How many Sundays fell on the first of the month during the twentieth century?
	/// </summary>
	public class Problem019 : SelfChecker, IProblem
	{
		public int Id
		{
			get { return 19; }
		}

		public string Solve()
		{
			var sundays = 0;
			for (var d = new DateTime(1901, 1, 1); d < new DateTime(2001, 1, 1); d = d.AddMonths(1))
				if (d.DayOfWeek == DayOfWeek.Sunday) sundays++;
			return sundays.ToString();
		}

		[Test]
		public override void Check()
		{
			Assert.AreEqual("171", Solve());
		}
	}
}